package pun.potato;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class SpectatorScreen extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
        setContentView(R.layout.spectatorscreen);
        
		Dialog puntDialog = createPuntDialog();
		puntDialog.show();
	}
	
	private Dialog createPuntDialog(){
		final View puntDialog = View.inflate(this, R.layout.puntexplaination, null);
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setTitle("Punting");
		LinearLayout layout = (LinearLayout)puntDialog.findViewById(R.id.linearlayout);
		LayoutParams lparams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
		TextView tv = new TextView(getApplicationContext());
		tv.setText("Punt Dialog");
		tv.setLayoutParams(lparams);
		layout.addView(tv);
		
		builder.setNegativeButton("Ok", new Dialog.OnClickListener() {

			@Override
			public void onClick(android.content.DialogInterface arg0, int arg1) {
				//cancel
			}
		});
		
		builder.setView(puntDialog);
		return builder.create();
	}

	
	
}
